#!/bin/bash

WORD_HOME=$(cd `dirname $0`;pwd)
WEB_DIR=/Users/tao.zeng/share/workspaces/supervisord4j-web/
STATIC_HOME=$WORD_HOME/src/main/resources/static/

echo $WORD_HOME

# build dist
cd $WEB_DIR && make prod && make tar && mv $WEB_DIR/supervisord4j-dist-*.tar.gz $WORD_HOME

# mv dist to resources
rm -rf $STATIC_HOME/* && cd $WORD_HOME && tar -zxf supervisord4j-dist-*.tar.gz && cp -r dist/* $STATIC_HOME/

# build package
./mvnw clean package -Dmaven.test.skip=true -DskipTests && mv supervisord4j-dist-*.tar.gz target
